#!/usr/bin/python
# -*- coding: UTF-8 -*-

import re
import sys
import os
import time
import threading
import datetime
import random

def runMysql():
    os.system("sudo service mysql restart > /dev/null 2>&1")

def runRedis():
    os.system("sudo service redis-server restart > /dev/null 2>&1")

def writefile(content, filepath, di):
    fp = open(filepath, di)
    fp.write(content)
    return fp.close()
  
if __name__ == '__main__':
    writefile('0', 'mysql-thread-num', 'w+')
    runMysql()
    runRedis()


